package com.winit.schedule.job.tracker.repository.mysql.dao;

import java.util.List;

import com.winit.schedule.core.repository.entity.QuartzSchedulerEntity;
import com.winit.schedule.core.repository.query.QuartzSchedulerQuery;
import com.winit.schedule.job.tracker.repository.mysql.plugin.SearchRequest;

public interface MysqlQuartzSchedulerDao {

    void saveScheduler(QuartzSchedulerEntity entity);

    void updateSchedulerStatusAndHeartbeatTime(QuartzSchedulerEntity entity);

    void updateSchedulerCommand(QuartzSchedulerEntity entity);

    QuartzSchedulerEntity getSchedulerByCompositeKey(QuartzSchedulerEntity entity);

    List<QuartzSchedulerEntity> querySchedulerPage(SearchRequest<QuartzSchedulerQuery> search);

    long querySchedulerPageCount(QuartzSchedulerQuery query);

    void deleteSchedulerByTaskTrackerUuid(String taskTrackerUuid);

    void cleanCommandByTaskTrackerUuid(String taskTrackerUuid);

    List<QuartzSchedulerEntity> querySchedulerCommnads(String taskTrackerUuid);
    
    public void deleteSchedulerTimeout(long timeout);
}
